package com.lizhe.conditional.config;

import com.lizhe.conditional.entity.People;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 类描述: 说明在config
 *
 * @author Administrator
 * @create 2022-06-13 21:58
 */
@Slf4j
@Configuration
public class config2 {

    @Bean
    // @ConditionalOnMissingBean(name = "city")
    @ConditionalOnBean(name = "city")
    public People people() {
        return new People("小伍", 19);
    }
}